package com.sdp.khy.baotou.db.khy_user_coupon.entity;

import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.activerecord.Model;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.time.LocalDate;
import java.time.LocalDateTime;

/**
 * <p>
 *
 * </p>
 *
 * @author zsp
 * @since 2024-06-07
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName("khy_user_coupon")
public class KhyUserCoupon extends Model<KhyUserCoupon> {

    private static final long serialVersionUID=1L;

    /**
     *  内码
     */
    @TableId("key_id")
    private String keyId;

    /**
     * 优惠券名称
     */
    @TableField("coupon_name")
    private String couponName;

    /**
     * 优惠券类型
     */
    @TableField("coupon_type")
    private String couponType;

    /**
     * 优惠数值
     */
    @TableField("coupon_value")
    private String couponValue;

    /**
     * 用户手机号
     */
    @TableField("user_no")
    private String userNo;

    /**
     * 创建时间
     */
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
    @TableField("create_time")
    private LocalDateTime createTime;

    /**
     * 有效期截止日期
     */
    @JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
    @DateTimeFormat(pattern="yyyy-MM-dd")
    @TableField("end_date")
    private LocalDate endDate;

    /**
     * 优惠券状态 0
     */

    @TableField("coupon_status")
    private String couponStatus;

    /**
     * 优惠券方案id
     */
    @TableField("scheme_id")
    private String schemeId;


    @Override
    protected Serializable pkVal() {
        return this.keyId;
    }

}
